using UnityEngine;

namespace IQIGame.USDK
{
    public interface IQIUSDKInterface
    {
        void init();
        void login();
        void logout();
        void exit();
        void switchAccount();
        bool isSupportExitDialog();
        bool isSupportSwitchAccount();


        void pay(PaymentParameters orderInfo, RoleInfo roleInfo);
        void extraFunc(ExtraFuncType type, string jsonData);
        void setAgreeProtocol();

        void enterGame(RoleInfo roleInfo);
        void createNewRole(RoleInfo roleInfo);
        void roleLevelUp(RoleInfo roleInfo);

        void roleSelectServer(RoleInfo roleInfo);

        void roleExitGame(RoleInfo roleInfo);

        void roleReport(RoleInfo roleInfo);


        int getChannelId();
        string getChannelName();
        int getImgId();
        string getCpsId();
        string getChannelSDKVersion();
        string getUSDKVersion();
        string getCustomParams(string key);
        string getUniqueId();
        string getTraceID();

    }

    public class UserInfo
    {
        public string channelUid;
        public string channelId;
        public string token;
        public string username;
        public bool firstLogin;


        #region Overrides of Object

        public override string ToString()
        {
            return JsonUtility.ToJson(this);
        }
        #endregion
    }

    public class RoleInfo
    {
        /// <summary>
        /// 角色ID
        /// </summary>
        public string roleId;
        /// <summary>
        /// 角色名称
        /// </summary>
        public string roleName;
        /// <summary>
        /// 区服ID 必须为整型字符串
        /// </summary>
        public string serverId;
        /// <summary>
        /// 区服名称
        /// </summary>
        public string serverName;
        /// <summary>
        /// 角色等级 必须为整型字符串
        /// </summary>
        public string roleLevel;
        /// <summary>
        /// 角色VIP等级 必须为整型字符串
        /// </summary>
        public string vipLevel;
        /// <summary>
        /// 战力 必须为整型字符串
        /// </summary>
        public string rolePower;
        /// <summary>
        /// /玩家账户余额 必须为整型字符串
        /// </summary>
        public string roleBalance;
        /// <summary>
        /// 角色创建时间(毫秒时间戳)
        /// </summary>
        public long roleCreateTime;
        /// <summary>
        /// 调用方法时的时间戳
        /// </summary>
        public long timestamp;
        /// <summary>
        /// 玩家公会名称
        /// </summary>
        public string partyName;
        /// <summary>
        /// 帮派id，必须为整型字符串
        /// </summary>
        public string partyId;
        /// <summary>
        /// 性别
        /// </summary>
        public string roleGender;
        /// <summary>
        /// 角色在帮派中的名字
        /// </summary>
        public string partyRoleName;
        /// <summary>
        /// 角色职业id，必须为整型字符串
        /// </summary>
        public string professionId;
        /// <summary>
        /// 角色职业名称
        /// </summary>
        public string professionName;
        /// <summary>
        /// 好友关系列表
        /// </summary>
        public string friendList;


        #region Overrides of Object

        public override string ToString()
        {
            return JsonUtility.ToJson(this);
        }

        #endregion
    }


    public enum ExtraFuncType
    {
        USER_CENTER = 10,
    }

    /*
	* SDK内购参数
	*/
    public class PaymentParameters
    {
        public string productId;
        public string cpExtras;
        public string cpOrderId;
        public string notifyUrl;
    }

    public class PayResultData
    {
        public string sdkOrderId;
        public string cpOrderId;
        public string cpExtras;
        public string msg;
    }

    public class ExtraFuncData
    {
        public int type;
        public string json;
        public string msg;
    }

}